Skip to content

[Server] Keep implicit stdio sessions alive while connected - #743

Open
Christiansada wants to merge 1 commit into
modelcontextprotocol:mainfrom
Christiansada:fix/672-default-stdio-session-lifetime
Open

Christiansada wants to merge 1 commit into
modelcontextprotocol:mainfrom
Christiansada:fix/672-default-stdio-session-lifetime

Conversation

@Christiansada

@Christiansada Christiansada commented Nov 13, 2026 •

Copy link
Copy Markdown

Addresses the default-configuration failure in #672: implicit stdio sessions survive idle time until connection closure, while setSession() retains the HTTP default and custom stores/managers retain their configured lifecycle. The regression covers a simulated two-hour idle interval, a correlated ping response and EOF cleanup; explicitly configured short TTLs are intentionally unchanged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the default stdio session-lifetime change.

No open issues 🎉

What changed in this PR

Addresses #672 by keeping default stdio sessions alive until connection closure, while preserving explicitly configured session lifecycles.

Changes:

  • Removes the practical idle timeout for implicit in-memory sessions without changing explicit session defaults or custom stores.
  • Adds regression coverage for two hours of idle time, a correlated ping response, and cleanup at connection closure.
  • Documents the default and explicitly configured stdio session lifecycles.
File Description
tests/​Unit/​Server/​BuilderTest.php Tests idle survival, connection cleanup, explicit expiry, and custom-store retention.
src/​Server/​Builder.php Uses the maximum integer TTL for the implicit in-memory session store.
docs/​run/​sessions.md Clarifies stdio session lifetime and setSession() behavior.

Review effort: Balanced

@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Nov 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants